Skip to main content

Library

Description

Use the following endpoints to generate your own library views.

Base URL

All following endpoints operates over the general Publica URL: app.publica.la

Endpoints
Library
Slider details
Issue details
Search

Authentication

In order to authenticate you must do the following:

  1. POST /api/v1/auth/login with the credentials of the user you want to authenticate. Using the following headers:
{
"X-Farfalla-Tenant-Id": {tenant_id},
}

The tenant_id is a unique identifier of your store in our platform. To get your tenant_id you must contact [email protected].

The credentials must be passed in a payload as follows:

{
"email":"[email protected]",
"password":"test-password",
"uuid":null,

}
  1. The system will return a Token in the following format:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2N5cHJlc3MtbWFzdGVyLXN0b3JlLnB1YmxpY2FsYS5tZS9hcGkvdjEvYXV0aC9sb2dpbiIsImlhdCI6MTYzNDA2NTExNSwiZXhwIjoxNjM0MDY4NzE1LCJuYmYiOjE2MzQwNjUxMTUsImp0aSI6IlNrWFk5SGlsUUQxTkJJQUgiLCJzdWIiOjU3Mzg0LCJwcnYiOiI4N2UwYWYxZWY5ZmQxNTgxMmZkZWM5NzE1M2ExNGUwYjA0NzU0NmFhIiwiaWQiOjU3Mzg0LCJhZG1pbiI6dHJ1ZSwicGxhbl9hZG1pbiI6ZmFsc2UsImVtYWlsIjoiY3lwcmVzc0BwdWJsaWNhLmxhIiwiZXh0ZXJuYWxfaWQiOm51bGwsInBpY3R1cmUiOiJodHRwczovL3d3dy5ncmF2YXRhci5jb20vYXZhdGFyL2MxMTA2ZjViYmQ2NGE5MjJmMjBkZjFjOTUxMzExYzFiP3M9MTYwJmQ9bW0mcj1nIn0.PjHPzOscVVbTDNpGm44zCWO6PhXkF-OWZANCrhqjLgE",
"token_type": "bearer",
"expires_in": 3600
}
  1. Include the previous token as authorization header in all your following requests.
{
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2N5cHJlc3MtbWFzdGVyLXN0b3JlLnB1YmxpY2FsYS5tZS9hcGkvdjEvYXV0aC9sb2dpbiIsImlhdCI6MTYzNDA2NTExNSwiZXhwIjoxNjM0MDY4NzE1LCJuYmYiOjE2MzQwNjUxMTUsImp0aSI6IlNrWFk5SGlsUUQxTkJJQUgiLCJzdWIiOjU3Mzg0LCJwcnYiOiI4N2UwYWYxZWY5ZmQxNTgxMmZkZWM5NzE1M2ExNGUwYjA0NzU0NmFhIiwiaWQiOjU3Mzg0LCJhZG1pbiI6dHJ1ZSwicGxhbl9hZG1pbiI6ZmFsc2UsImVtYWlsIjoiY3lwcmVzc0BwdWJsaWNhLmxhIiwiZXh0ZXJuYWxfaWQiOm51bGwsInBpY3R1cmUiOiJodHRwczovL3d3dy5ncmF2YXRhci5jb20vYXZhdGFyL2MxMTA2ZjViYmQ2NGE5MjJmMjBkZjFjOTUxMzExYzFiP3M9MTYwJmQ9bW0mcj1nIn0.PjHPzOscVVbTDNpGm44zCWO6PhXkF-OWZANCrhqjLgE"
}

Library

GET /api/v1/public/library

Use this endpoint to build the front of your store.

Each row of issues is further called Slider. Each slider filters the number of issues up to 12 items. If you want to get more issues of the same filter use Slider details endpoint

image

Response

CodeDescription
200Success
404Object not found
401Unauthenticated

Response example

Example
{
"code": "SUCCESS",
"data": {
"libraryMode": null,
"ppuLibrary": false,
"issuesGroups": [
{
"slug": "collection",
"filter": "latest",
"title": "Title of the first slider",
"issues": [
{
"id": 446137,
"name": "Name of the first issue",
"slug": "slug-of-the-first-issuer-1625589334",
"cover": "https://storage-aws-production.publica.la/{your_store}/issues/2021/07/qWQ9xo6ifTGJzeDp/1625589358_cover.jpg",
"thumbnail": "https://storage-aws-production.publica.la/{your_store}/issues/2021/07/qWQ9xo6ifTGJzeDp/1625589358_thumbnail.jpg",
"published_at": {
"timestamp": 1625578268,
"date": "2021-07-06 13:31:08",
"timezone": "+00:00"
},
"license": "owner",
"user_can_read": true,
},
{...},
{...},
{...},
{...},
{...},
{...},
{...},
{...},
{...},
{...},
{...}
]
},
{...}
]
}
}

Slider details

GET /api/v1/public/slider?collection=latest

Using this endpoint you'll get All issues of a certain slider.

slider-details

tip

Build the query parameters using the slug and the filter of the response above

Response

CodeDescription
200Success
404Object not found
401Unauthenticated

Response Example

Example
{
"code": "SUCCESS",
"data":[
{
"id": 446137,
"name": "Grimms' Fairy Tales",
"slug": "grimms-fairy-tales-1625589334",
"cover": "https://storage-aws-production.publica.la/{your_store}/issues/2021/07/qWQ9xo6ifTGJzeDp/1625589358_cover.jpg",
"thumbnail": "https://storage-aws-production.publica.la/{your_store}/issues/2021/07/qWQ9xo6ifTGJzeDp/1625589358_thumbnail",
"published_at": {
"timestamp": 1625578268,
"date": "2021-07-06 13:31:08",
"timezone": "+00:00"
},
"license": "owner",
"user_can_read": true
},
{...},
{...}
]
}

Issue details

GET /api/v1/public/library/issue/{issue_id}

Use this endpoint to build the details page of the issue.

issue-details

Response

CodeDescription
200Success
404Object not found
401Unauthenticated

Response Example

Example
{
"code": "SUCCESS",
"data":[
{
"id": 446137,
"name": "Grimms' Fairy Tales",
"slug": "grimms-fairy-tales-1625589334",
"cover": "https://storage-aws-production.publica.la/{your_store}/issues/2021/07/qWQ9xo6ifTGJzeDp/1625589358_cover.jpg",
"thumbnail": "https://storage-aws-production.publica.la/{your_store}/issues/2021/07/qWQ9xo6ifTGJzeDp/1625589358_thumbnail",
"published_at": {
"timestamp": 1625578268,
"date": "2021-07-06 13:31:08",
"timezone": "+00:00"
},
"license": "owner",
"user_can_read": true
},
{...},
{...}
]
}

GET /api/v1/public/library/search?subject=el%20gato&page=1

tip

The limit of issues per page is 20

Response

CodeDescription
200Success
404Object not found
401Unauthenticated

Response Example

Example
{
"code": "SUCCESS",
"data":{
"issues": [
{
"id": 446137,
"name": "Name of the first issue",
"slug": "slug-of-the-first-issuer-1625589334",
"cover": "https://storage-aws-production.publica.la/{your_store}/issues/2021/07/qWQ9xo6ifTGJzeDp/1625589358_cover.jpg",
"thumbnail": "https://storage-aws-production.publica.la/{your_store}/issues/2021/07/qWQ9xo6ifTGJzeDp/1625589358_thumbnail.jpg",
"published_at": {
"timestamp": 1625578268,
"date": "2021-07-06 13:31:08",
"timezone": "+00:00"
},
"license": "owner",
"user_can_read": true,
},
],
},
}